# -*- coding:utf-8 -*-
# !/usr/bin/env
# @description 采集测试环境常量配置文件
# @author:jack.spanrrows
# @datetime: 2018/07/30 23:29
# @copyRight jack.spanrrows@gmail.com

import os
from datetime import datetime
DEBUG_OPEN = False
today = datetime.now().strftime("%Y-%m-%d")
year = datetime.now().strftime("%Y")
month = datetime.now().strftime("%m")
day = datetime.now().strftime("%d")
BASEPATH = os.path.dirname(os.path.realpath(__file__))+"/../../"

logs_dir = "%slogs" % (BASEPATH)

run_logs_dir = "%s/%s" % (logs_dir,today)

db_log = "db.log"

run_log = "run.log"

mongo_log = "mongo.log"

db_logs = "%s/%s" % (run_logs_dir, db_log)

run_logs = "%s/%s" % (run_logs_dir, run_log)

mongo_logs = "%s/%s" % (run_logs_dir, mongo_log)

images_save_dir = "static/images/%s/%s/%s/" % (year, month, day)

image_dir = "%spublic/%s" % (BASEPATH,images_save_dir)

DBHOST = "127.0.0.1"
DBPORT = 27017
MONGODB_EXPIRE = 7200
MONGODB_MAX_EXPIRE = 24 * 60 * 60 * 30
MONGO_MIN_EXPIRES = 240
GET = "GET"

CREATE = "CREATE"

ADD_MIN_TIMESTAMP = "add_micro_timestamp"

ADD_DAY = "add_day"

UC_DATE = datetime.utcnow()

STATUS = 1

I = 0

year = datetime.now().strftime("%Y")

DATABASE = "dissertation_advertist_web"
DUPLICATE_KEY_UPDATE = "ON DUPLICATE KEY UPDATE"


LAGOU_URL = "https://www.lagou.com/"
LAGOU_TYPE = 1

LAGOU_KEY = "lagou"
LAGOU_VALUE = "99"

COMPANY_TYPE = 'company'

JOBS_TYPE = "jobs"

CATEGORY_TYPE = "category"

SOURCE_URL = "http://www.lagou.com"


TABLE_CATEGORY = "advertist_category"

TABLE_CATEGORY_LIST = "advertist_category_list"

TABLE_COMPANY_INFO_TMP = "advertist_scrapy_company_info_tmp"

TABLE_JOBS_INFO_TMP = "advertist_scrapy_jobs_info_tmp"

POINT = '·'

JOBS_MONGO_KEY = "jobs_list"
JOBS_MONGO_VALUE = 1
JOBS_MONGO_EXPIRES =  24 * 60 * 60 * 2


CATEGORY_MONGO_KEY = "category"

CATEGORY_MONGO_VALUE = 1

CATEGORY_MONGO_EXPIRES = 240